﻿#ifndef ALARMHISTORYSCENE_H
#define ALARMHISTORYSCENE_H

#include <QGraphicsScene>

enum WarningLevel {
    Normal = 0,         //一般
    Serious,            //严重
    Danger              //危险
};

class QVariantAnimation;
class QGraphicsItemGroup;
class AlarmHistoryScene : public QGraphicsScene
{
    Q_OBJECT

public:
    explicit AlarmHistoryScene(QObject *parent = 0);

    void addAlarmText(WarningLevel level, const QString &alarm);
    void clear();

private:
    void updateAnimation();

private:
    QStringList m_alarmList;
    QGraphicsItemGroup *m_pItemGroup = nullptr;
    QVariantAnimation *m_pAnimation = nullptr;
};

#endif // ALARMHISTORYSCENE_H
